#!/bin/sh
chmod +x /etc/init.d/netspeedtest  >/dev/null 2>&1
[  `uci -q get partexp.global` ]  && uci set partexp.global=global
[  `uci -q get netspeedtest.netspeedtest` ]  || uci set netspeedtest.netspeedtest=netspeedtest
[  `uci -q get netspeedtest.speedtestiperf3` ] || uci set netspeedtest.speedtestiperf3=speedtestiperf3
[  `uci -q get netspeedtest.speedtestport` ]  || uci set netspeedtest.speedtestport=speedtestport
[  `uci -q get netspeedtest.speedtestwan` ]  || uci set netspeedtest.speedtestport=speedtestwan
LOGD=/etc/netspeedtest
LOG=/var/log/netspeedtest.log
LOGE=$LOGD/netspeedtest.log
LOGT=$LOGD/netspeedtestpos
[ -d "$LOGD" ] || mkdir -p $LOGD
[ -f "$LOGE" ] || echo "start" > $LOG
[ -f "$LOGT" ] || echo "start" > $LOGT
[ -f "$LOG" ] || echo "start" > $LOG

rm -rf /tmp/luci-modulecache /tmp/luci-indexcache*
exit 0
